MediaReplay

interface MediaReplay : Replay

Media replay stream control interface.

Provides control over some remote media stream, allowing to control playback.

Every client that requests a reference on a media replay stream is given its own dedicated instance of that stream. Multiple, independent stream may thus be open from the same media.

This stream does not support suspension. When it gets interrupted because another stream starts, or because streaming gets disabled globally, then it will move to the STOPPEDstate and will remain in that state even once the interrupting stream stops, or streaming gets enabled. Also, this implies that this stream cannot be started while streaming is globally disabled.

The stream is stopped and released as soon as the reference that provides it is closed. All open sinks are closed as a consequence.

Types

Link copied to clipboard
interface Source : Parcelable
Identifies a source for media replay.

Functions

Link copied to clipboard
@IntRange(from = 0)
abstract fun duration(): Long
Informs about total playback duration.
Link copied to clipboard
Opens a sink from this stream.
Link copied to clipboard
abstract fun pause(): Boolean
Requests playback to pause.
Link copied to clipboard
abstract fun play(): Boolean
Requests playback to start.
Link copied to clipboard
Informs about current playback state.
Link copied to clipboard
@IntRange(from = 0)
abstract fun position(): Long
Informs about current playback position.
Link copied to clipboard
abstract fun seekTo(@IntRange(from = 0) position: Long): Boolean
Requests playback position change.
Link copied to clipboard
Informs about the configured source for this media replay stream.
Link copied to clipboard
abstract fun state(): Stream.State
Informs about current stream state.
Link copied to clipboard
abstract fun stop()
Stops the stream.
Link copied to clipboard
Creates a source for streaming a media resource.